package com.qingcloud.api.dcengine.service;

import com.qingcloud.api.dcengine.dto.TablePageDTO;
import com.qingcloud.api.dcengine.dto.edata.CommonEquipmentData;
import com.qingcloud.api.dcengine.dto.edata.CommonEquipmentDataV2;
import com.qingcloud.api.dcengine.model.edata.EquipmentDataListParam;
import com.qingcloud.api.dcengine.model.edata.EquipmentDataPageParam;
import com.qingcloud.api.dcengine.model.edata.EquipmentUpdateGpsParam;
import com.qingcloud.api.dcengine.service.fallback.EquipmentDataApiFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 设备数据接口
 */
@FeignClient(name = "equipment-data-api", url = "${data-url}",
        fallback = EquipmentDataApiFallback.class)
public interface EquipmentDataApi {

    /**
     * 分钟数据通用列表接口
     */
    @PostMapping("/edata/minute/list")
    List<CommonEquipmentDataV2> minuteList(@RequestBody EquipmentDataListParam listParam);

    /**
     * 分钟数据通用分页查询接口 新
     */
    @PostMapping("/edata/minute/page")
    TablePageDTO<CommonEquipmentDataV2> minutePage(@RequestBody EquipmentDataPageParam pageParam);

    /**
     * 小时数据通用列表接口
     */
    @PostMapping("/edata/hour/list")
    List<CommonEquipmentDataV2> hourList(@RequestBody EquipmentDataListParam listParam);

    /**
     * 小时数据通用分页查询接口 新
     */
    @PostMapping("/edata/hour/page")
    TablePageDTO<CommonEquipmentDataV2> hourPage(@RequestBody EquipmentDataPageParam pageParam);

    /**
     * 天数据通用列表接口
     */
    @PostMapping("/edata/day/list")
    List<CommonEquipmentData> dayList(@RequestBody EquipmentDataListParam listParam);

    /**
     * 天数据通用分页查询接口
     */
    @PostMapping("/edata/day/page")
    TablePageDTO<CommonEquipmentData> dayPage(@RequestBody EquipmentDataPageParam pageParam);

    /**
     * 更新设备上传的数据经纬度
     *
     * @return 更新的数据数量
     */
    @PostMapping("/edata/minute/updateGps")
    int updateGps(@RequestBody List<EquipmentUpdateGpsParam> gpsParamList);

}
